{layout name="layout/default" /}

<form class="layui-form" action="{:url('add')}" method="post">

    <div class="layui-form-item">
        <label class="layui-form-label">父级：</label>
        <div class="layui-input-block">
            {:build_select('row[pid]', $groupdata, null, ['class'=>'form-control selectpicker', 'data-rule'=>'required'])}
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">名称：</label>
        <div class="layui-input-block">
            <input type="text" name="row[title]" lay-verify="require" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">权限：</label>
        <div class="layui-input-block" id='rule'>
            {:build_select('row[rules][]', $ruledata, null, ['class'=>'form-control selectpicker', 'multiple'=>'', 'data-rule'=>'required'])}
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">状态：</label>
        <div class="layui-input-block">
            <input type="radio" name="row[status]" value="正常" title="正常" checked="">
            <input type="radio" name="row[status]" value="隐藏" title="隐藏">
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="add">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
<script>
    layui.use(['jquery', 'form'], function() {
        form = layui.form,
            $ = layui.jquery;
        form.verify({

        });

    })
</script>
</body>

</html>